/*
* Created by: yyf
* Description: 母基金管理--投资中母基金 子基金回款
*/
<template>
    <!--列表-->
    <div class="ca-box-border-top-none ca-p-20">
        <el-row class="ca-title">
            <h3>基金回款</h3>
            <el-table :data="paymentData" class="ca-table">
                <el-table-column label="基金简称" prop="fundName" width="200px">
                    <template slot-scope="scope">
                        <el-button type="text" :disabled="scope.row.existence" @click="toSonFund(scope.row.id)">{{scope.row.fundName}}</el-button>
                    </template>
                </el-table-column>
                <el-table-column label="管理机构" prop="mechanismName"></el-table-column>
                <el-table-column label="认缴金额(万元)" prop="subscribed">
                    <template slot-scope="scope">
                        {{scope.row.subscribed | format1}}
                    </template>
                </el-table-column>
                <el-table-column label="实缴金额(万元)" prop="paid">
                    <template slot-scope="scope">
                        {{scope.row.paid | format1}}
                    </template>
                </el-table-column>
                <el-table-column label="权益占比" prop="legalRight"></el-table-column>
                <el-table-column label="回款金额(万元)" prop="payment">
                    <template slot-scope="scope">
                        {{scope.row.payment | format1}}
                    </template>
                </el-table-column>
                <el-table-column label="基金状态" prop="fundState">
                    <template slot-scope="scope">
                        {{scope.row.fundState | getNameById('fundCostState')}}
                    </template>
                </el-table-column>
            </el-table>
        </el-row>
    </div>
</template>

<script type="text/ecmascript-6">
        import {api} from '../api';
        import {STATUS_HTTP_SUCCESS, apiHttp} from '__service/csHttp';
    //    import {isNoAuth} from '__service/utils';
    export default {
        data() {
            return {
                itemId: this.$route.params.itemId,
                paymentData: [],
            }
        },
        props: {
        },
        mounted() {
            this.getPaymentList();
        },
        methods: {
            // 获取基金子基金回款列表
            async getPaymentList() {
                let {resCode, data} = await apiHttp(api.GET_PAYMENT_LIST, {fundId: this.itemId});
                if (resCode === STATUS_HTTP_SUCCESS) {
                    this.paymentData = data;
//                    console.log(data, '基金回款');
                }
            },
            // 跳转到子基金
            toSonFund(id) {
                this.$router.push({name: 'invested-fund', params: {fundId: id, tabIndex: '0', openWindow: true}})
            },
        },
        components: {
        },
    }
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>
